/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package padraoIterator;

import java.util.Iterator;
import managementcollaborators.*;

/**
 *
 * @author Kdc
 */
public class ColaboradorIt implements Iterator {

    Collaborator colaboradores[];
    int posicao;

    public ColaboradorIt(Collaborator[] colab) {

        colaboradores = colab;
        posicao = 0;

    }

    @Override
    public boolean hasNext() {

        if (posicao < colaboradores.length) {
            return true;
        } else {
            return false;
        }

    }

    @Override
    public Object next() {

        Collaborator c = colaboradores[posicao];
        posicao += 1;
        return c;

    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
